package com.itheima.thread.threadOrderByOrder;

/**
 * @Author: Ethan Yankang
 * @Program: interview
 * @Date: 2024-07-28 16:38
 **/
public class ThreadsByOrder {
    public static void main(String[] args) {

        Thread thread1=new Thread(()->{
            System.out.println("t1线程启动了");
        });

        Thread thread2=new Thread(()->{
            try {
                thread1.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("t2线程启动了");
        });

        Thread thread3=new Thread(()->{
            try {
            thread2.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("t3线程启动了");
        });

        thread2.start();
        thread3.start();
        thread1.start();

    }
}
